﻿using System;

namespace CommonUtils
{
    public abstract class Singleton<T> where T : new()
    {
        // 使用Lazy<T>来实现延迟初始化和线程安全
        private static readonly Lazy<T> _instance = new Lazy<T>(() => new T(), true);
        
        protected Singleton()
        {
        }
        
        public static T Instance => _instance.Value;
    }
}